﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Medical_Store_Billing.Business_Login_Layer;

namespace Medical_Store_Billing
{
    public partial class Form_timkiemxuathang : Form
    {
        XuathangBLL m_xuathang;
        public Form_timkiemxuathang()
        {
            InitializeComponent();
        }

        private void Form_timkiemxuathang_Load(object sender, EventArgs e)
        {
            m_xuathang = new XuathangBLL();
            dataGridView1.DataSource = m_xuathang.laydsxh();
        }

        private void btntimkiem_Click(object sender, EventArgs e)
        {
            m_xuathang = new XuathangBLL();
            dataGridView1.DataSource = m_xuathang.Timxuathang(txttimkiem.Text);
        }

        private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            int i = e.RowIndex;
            m_xuathang = new XuathangBLL();
            dataGridView2.DataSource = m_xuathang.Laychitietxuat(dataGridView1.Rows[i].Cells[0].Value.ToString());
        }
    }
}
